package com.nc.delivery_project.server.domain;

import java.util.List;

/**
 * Created by miroshnik on 01.12.14.
 */
public class StateProvince {
	
	private int stateId;

    private String stateTitle;
    
    private Country country;
    
    private List<City> cities;

	public StateProvince() {

	}
	
	

	public StateProvince(int stateId) {
		super();
		this.stateId = stateId;
	}



	public StateProvince(int stateId, String stateTitle, Country country) {
		super();
		this.stateId = stateId;
		this.stateTitle = stateTitle;
		this.country = country;
	}

	public int getStateId() {
		return stateId;
	}

	public void setStateId(int stateId) {
		this.stateId = stateId;
	}

	public String getStateTitle() {
		return stateTitle;
	}

	public void setStateTitle(String stateTitle) {
		this.stateTitle = stateTitle;
	}

	public Country getCountry() {
		return country;
	}

	public void setCountry(Country country) {
		this.country = country;
	}
	
	

	@Override
	public String toString() {
			final StringBuilder sb = new StringBuilder("StateProvince{");
	        sb.append("stateId=").append(stateId);
	        sb.append(", stateTitle='").append(stateTitle).append('\'');
	        sb.append(", country='").append(country);
	        sb.append('}');
	        return sb.toString();
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = stateId;
		result = prime * result + ((country == null) ? 0 : country.hashCode());
		result = prime * result
				+ ((stateTitle == null) ? 0 : stateTitle.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)  return true;
		if (!(obj instanceof StateProvince))return false;
		
		StateProvince statePr = (StateProvince) obj;
		
		if(stateTitle != null ? !stateTitle.equals(statePr.stateTitle) : statePr.stateTitle != null) return false;
		if(country != null ? !country.equals(statePr.country) : statePr.country != null) return false;
		
		
		
		return true;
	}



	public List<City> getCities() {
		return cities;
	}



	public void setCities(List<City> cities) {
		this.cities = cities;
	}
    
    
	
}
